<template>
  <div class="main">
    <!-- <stady></stady>
    <hr>
    <pinpai></pinpai> -->

    <MyHeader title="购物车案例666"></MyHeader>

    <MyGoods v-for="item in list" :key="item.goods_id" :obj='item'></MyGoods>
    
    <MyFooter :obj='list'></MyFooter>

  </div>
</template>

<script>
import stady from './components/学生信息管理.vue'
import pinpai from './components/品牌管理.vue'

//购物车
import axios from 'axios'
import MyHeader from './components/MyHeader.vue'
import MyGoods from './components/MyGoods.vue'
import MyFooter from './components/MyFooter.vue'


export default {
  data(){
    return{
      list:[]
    }
  },
components:{
  stady,
  pinpai,

  MyHeader,
  MyGoods,
  MyFooter
},
created(){
    this.getList()
},
 methods:{
     async getList() {
      const {data:res}= await axios.get('https://applet-base-api-t.itheima.net/api/cart')
      console.log(res);
      this.list=res.list
      }
    }
}
</script>

<style scoped>
	.main {
		padding-top: 45px;
		padding-bottom: 50px;
	}
</style>
